package com.example.mythealthapp.food_grid

import android.graphics.BitmapFactory
import android.net.Uri
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.example.mythealthapp.R
import kotlinx.android.synthetic.main.activity_identify.*


class IdentifyActivity : AppCompatActivity() {

    lateinit var imgUri : Uri

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_identify)
        val intent = intent
        //得到照片uri
        imgUri=Uri.parse(intent.getStringExtra("imguri"))

        val bitmap=BitmapFactory.decodeStream(contentResolver.openInputStream(imgUri))
        identify_img.setImageBitmap(bitmap)
    }
}